home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / util / rm / rm.doc < prev    next >
Text File  |  1990-01-28  |  8KB  |  312 lines

  1.  
  2.  
  3.      Page 1                 RM's Documentation                  Page 1
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                     RM
  22.                    (c) Copyright 1989 by Martin J. Laubach
  23.                             All rights reserved
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.   1. Introduction      
  33.  
  34.        It happened again. Just now. You wanted to delete a couple of
  35.      files, and one tiny extra space crept in. The result -- "delete
  36.      t: #?", was devastating. A week's work is gone.  
  37.  
  38.        That's where rm comes in. Instead of immediately deleting the
  39.      files, they will be moved to some trash directory. When you are
  40.      sure everything is OK (after some minutes when everything has
  41.      settled), you can empty it (at my place this automatically
  42.      happens once a day -- files older than 24 hours are then
  43.      erased).  
  44.  
  45.  
  46.   2. How to     
  47.  
  48.        You will have to create a directory called "Junk" (or
  49.      something else, see below for more on that subject) that will
  50.      temporarily hold the rm'ed files, in the root of each volume you
  51.      intend to use rm on -- ie. for each partition on your hard
  52.      drive, if your partitions are called DH0: and DH1:, you need
  53.      "DH0:Junk", "DH1:Junk".  
  54.  
  55.        Now, when you are rm'ing a file, it is not immediately
  56.      physically erased, but rather moved to that "Junk" directory.
  57.      Now, should you discover you just (accidentially, of course)
  58.      rm'ed some important file, all you have to do to recover it is
  59.      to go to the Junk directory, and move or copy the file back.  
  60.  
  61.  
  62.      How to
  63.  
  64.  
  65.      Page 2                 RM's Documentation                  Page 2
  66.  
  67.  
  68.  
  69.        Rm, of course, supports wildcards. "Rm #?" will delete
  70.      everything in your local directory (including directories and
  71.      "busy" files). "Rm #?.o" will remove all object modules --
  72.      please see your AmigaDOS manual for more information on
  73.      wildcards.  
  74.  
  75.        You may also give it more than one parameter: "rm foo bar baz"
  76.      will attempt to remove the files or directories called foo, bar
  77.      and baz (in that order). If one of the removals fails, the whole
  78.      operation is aborted with an appropriate error message.  
  79.  
  80.  
  81.        Once you really are sure you haven't removed anything lethal
  82.      (typically the next day), you can really (physically) delete the
  83.      files. The enclosed "purge" script, which needs the arp shell
  84.      and ARexx to run (one could do without ARexx -- it's just bells
  85.      and whistles), goes through each existing junk directory and
  86.      does such a delete.  
  87.  
  88.  
  89.   3. Goodies      
  90.  
  91.        And finally -- two more bonus points: First, rm is very short
  92.      (752 bytes in the current version). That's for the people with
  93.      the very-full-c-directory-mania. And second, rm is completely
  94.      reentrant and can be made resident (e.g. with ARes). That's for
  95.      the people with the strange I-still-have-two-megs-left feeling.  
  96.  
  97.  
  98.   3.1. Bells    
  99.  
  100.        Since I hate iron cast (read hard coded) definitions, you are
  101.      of course not limited calling the directory "Junk" -- it's just
  102.      the default name.  Should you want to use your WorkBench
  103.      "TrashCan" directory, "T", or anything else, here is how to do
  104.      so. Using environment variables, you can assign the trash
  105.      directory to whatever name you want. All you have to do is a
  106.      "Set JUNK MyDir" (e.g. in the startup-sequence), and the rm'ed
  107.      files will go into ":MyDir" instead.  
  108.  
  109.  
  110.   3.2. Whistles    
  111.  
  112.        Another nice feature of rm is that it allows multiple versions
  113.      of files.  Suppose you just rm'ed "Foo:Foo", and you now remove
  114.      "Bar:Foo" -- rm won't overwrite the first version with the
  115.      second (and thus effectively deleting the first), but keep it
  116.      and add a version number to each same file that is deleted. The
  117.      first time you remove "Foo", it will be moved to ":Junk/Foo".
  118.      Each following removal of a file called "Foo" results in
  119.      ":Junk/Foo;1", ":Junk/Foo;2" and so on.  
  120.  
  121.  
  122.  
  123.  
  124.      Goodies                                               Whistles
  125.  
  126.  
  127.      Page 3                 RM's Documentation                  Page 3
  128.  
  129.  
  130.   4. Caveats      
  131.  
  132.        Rm needs the "arp.library", version 39 or higher to run.  
  133.  
  134.        Since the files aren't physically removed, you will need some
  135.      free space on each volume -- just rm'ing files won't give you
  136.      more space on a 99% full drive. You will have to purge the trash
  137.      directories.  
  138.  
  139.        The junk directory must reside on the current volume -- since
  140.      it is not possible to rename files across volumes, that means
  141.      that every partition of your harddisk must have such a junk
  142.      directory.  
  143.  
  144.        Also, I can't really imagine using this tool on a floppy-only
  145.      system.  
  146.  
  147.        You shouldn't let the Junk directory grow too large --
  148.      especially when there are many versions of a file, rm will take
  149.      longer and longer. It's probably not a good idea to keep "Bar"
  150.      to "Bar;999", as now "rm Bar" will take rather long to execute.  
  151.  
  152.  
  153.   5. What      
  154.  
  155.        In this archive, you should find the following files: 
  156.  
  157.              rm.doc .... What you are reading right now.
  158.              rm.asm .... The source for rm.
  159.              makefile .. Guess what.
  160.              rm ........ The executable
  161.              purge ..... A script to purge the junk directory
  162.  
  163.  
  164.   6. Where      
  165.  
  166.        If you have any comments, ideas what could or should be
  167.      improved, bug reports or just like to chat a bit, please feel
  168.      free to contact me at one of the following addresses... I just
  169.      *love* receiving mail! 
  170.  
  171.        Usenet:  mjl@alison.at 
  172.                 ..!uunet!mcsun!tuvie!alison!mjl 
  173.  
  174.          or 
  175.  
  176.        FidoNet: "Martin Laubach" at 2:310/3.14 
  177.  
  178.  
  179.        Looking forward to reading from you, 
  180.  
  181.              mjl 
  182.  
  183.  
  184.  
  185.  
  186.      Where
  187.  
  188.  
  189.      Page 4                 RM's Documentation                  Page 4
  190.  
  191.  
  192.  
  193.   7. License      
  194.  
  195.        This material is (c) Copyright 1989 by Martin J. Laubach -- All
  196.      rights reserved.  
  197.  
  198.        It may be distributed freely as long as the following
  199.      restrictions are met: 
  200.  
  201.        The distributor may charge a fee to recover distribution
  202.      costs. The fee for diskette distribution should not be more than
  203.      the cost to obtain the same diskette from Fred Fish.  
  204.  
  205.        The distributor agrees to cease distributing the programs and
  206.      data involved if requested to do so by the author.  
  207.  
  208.        You may copy and distribute verbatim copies of the program's
  209.      executable code and documentation as you receive it, in any
  210.      medium, provided that you conspicuously and appropriately
  211.      publish only the original, unmodified program, with all
  212.      copyright notices and disclaimers of warranty intact and
  213.      including all the accompanying documentation, example files and
  214.      anything else that came with the original.  
  215.  
  216.        The author will not be liable for any damage arising from the
  217.      failure of this program to perform as described, or any
  218.      destruction of other programs or data residing on a system
  219.      attempting to run the program.  While I know of no damaging
  220.      errors, the user of this program uses it at his or her own
  221.      risk.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.      License
  249.  
  250.  
  251.      Page 5                 RM's Documentation                  Page 5
  252.  
  253.  
  254.   8. Road Map    
  255.  
  256.  
  257.  
  258.         1. Introduction     ....................................    1
  259.         2. How to    ...........................................    1
  260.         3. Goodies     .........................................    2
  261.            3.1. Bells   ........................................    2
  262.            3.2. Whistles   .....................................    2
  263.         4. Caveats     .........................................    2
  264.         5. What     ............................................    3
  265.         6. Where     ...........................................    3
  266.         7. License     .........................................    4
  267.         8. Road Map    .........................................    5
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.      Road Map
  311.  
  312.